package com.cn.lp.openapi.reflect;

import net.sf.cglib.reflect.FastMethod;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class CGlibMethod implements GMethod {

	private final Method method;

	private final FastMethod fastMethod;

	public CGlibMethod(Method method, FastMethod fastMethod) {
		super();
		this.method = method;
		this.fastMethod = fastMethod;
	}

	public Method getJavaMethod() {
		return method;
	}

	public Class<?>[] getParameterTypes() {
		return fastMethod.getParameterTypes();
	}

	public Class<?> getReturnType() {
		return fastMethod.getReturnType();
	}

	public Class<?> getDeclaringClass() {
		return fastMethod.getDeclaringClass();
	}

	public String getName() {
		return fastMethod.getName();
	}

	public Class<?>[] getExceptionTypes() {
		return fastMethod.getExceptionTypes();
	}

	public Object invoke(Object obj, Object... args) throws InvocationTargetException {
		return fastMethod.invoke(obj, args);
	}

}
